public class demo {
    class Solution {
        public int[] twoSum(int[] nums, int target) {
            int[] ret =new int[2];
            for(int i = 0; i<nums.length;i++)
            {
                int sum = 0;
                for(int j = i+1;j<nums.length;j++)
                {
                    sum = nums[i]+nums[j];
                    if(sum == target)
                    {
                        ret[0] = i;
                        ret[1] = j;
                        return ret;
                    }
                }
            }
            return null;
        }

        public class demo {
            public static void main(String[] args) {
                int[] add = {0, 2, 6, 8};
                int sum = 10;
                Solution s1 = new Solution();
                s1.twoSum(add, sum).toString();

            }
        }
}
